package com.topnav.mc.admin.entity.bean;

import com.topnav.mc.admin.entity.OperateLog;
import com.topnav.mc.admin.entity.enums.EnumLogType;
import com.topnav.mc.admin.entity.enums.EnumModal;
import com.topnav.mc.admin.entity.enums.EnumOperateFunction;
import lombok.Data;

/**
 * @Author: kenny
 * @Date: 2024/3/29 16:49
 */
@Data
public class OperateLogBean extends OperateLog {
    private String userCode;
    private String userName;
    private String functionDesc;
    private String logTypeDesc;

    public String getFunctionDesc() {
        EnumOperateFunction entity = EnumOperateFunction.getByCode(this.getFunctionId());
        if (entity != null){
            return entity.getEngKey();
        }
        return  null;
    }

    public String getLogTypeDesc() {
        EnumLogType entity = EnumLogType.getByCode(this.getLogType());
        if (entity != null){
            return entity.getEngKey();
        }
        return  null;
    }
}
